package testing;

import pt.ist.meic.pava.SyncCommons.Atomic;
import pt.ist.meic.pava.SyncCommons.Shared;

@Shared
public class Account {
	
	public int balance;
	private int a;
	
	public Account(int initial) {
		
		//this.a = balance;
		this.balance = initial;
		//System.out.println("a="+this.a);
	}
	
	@Atomic
	public void deposit(int amount) {
		
		this.balance = this.balance + amount;
	}
	
	public void withdraw(int amount) {
		
		deposit(-amount);
	}
	
	@Atomic
	public int getBalance() {
		
		return balance;
	}
}
